package com.hzncc.flowable_diboot.project_contracts.vo;

import com.diboot.core.binding.annotation.BindField;
import com.diboot.iam.entity.IamUser;
import com.hzncc.flowable_diboot.entity.SapCustomer;
import com.hzncc.flowable_diboot.project_contracts.entity.ProjectContractAmount;
import com.hzncc.flowable_diboot.project_contracts.entity.ProjectContractAudit;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

@Data
@EqualsAndHashCode(callSuper = true)
public class OldReceivablesVO extends ProjectContractAudit {


    /**
     * 创建人 关联信息
     */

    @BindField(
            entity = IamUser.class,
            field = "realname",
            condition = "this.create_by = id"
    )
    private String createByLabel;

    /**
     * 更新人 关联信息
     */

    @BindField(
            entity = IamUser.class,
            field = "realname",
            condition = "this.update_by = id"
    )
    private String updateByLabel;

    /**
     * 销售员
     */
    @BindField(
            entity = IamUser.class,
            field = "realname",
            condition = "this.saler = id"
    )
    private String salerName;

    /**
     * 总金额
     */
    @BindField(
            entity = ProjectContractAmount.class,
            field = "contractSalesTotalAmount",
            condition = "this.id = contract_id"
    )
    private BigDecimal contractSalesTotalAmount;

    /**
     * 已收金额
     */
    @BindField(
            entity = ProjectContractAmount.class,
            field = "collectedAmount",
            condition = "this.id = contract_id"
    )
    private BigDecimal collectedAmount;

    /**
     * 未收金额
     */
    @BindField(
            entity = ProjectContractAmount.class,
            field = "uncollectedAmount",
            condition = "this.id = contract_id"
    )
    private BigDecimal uncollectedAmount;

    /**
     * SAP客户编码
     */
    @BindField(
            entity = SapCustomer.class,
            field = "sapNo",
            condition = "this.customerId = id"
    )
    private String SapCustomerCode;
}
